package com.mcintyret.site.security;

import com.google.common.collect.Sets;
import org.springframework.security.core.GrantedAuthority;

import java.util.Set;

/**
 * User: mcintyret2
 * Date: 07/04/2012
 */
public enum GrantedAuthorityEnum implements GrantedAuthority {

    ROLE_USER,
    ROLE_ADMIN;

    public static final Set<GrantedAuthorityEnum> USER = Sets.immutableEnumSet(ROLE_USER);
    public static final Set<GrantedAuthorityEnum> ADMIN = Sets.immutableEnumSet(ROLE_ADMIN, ROLE_USER);


    @Override
    public String getAuthority() {
        return name();
    }
}
